package com.witframework.core.persistence;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.HibernateTemplate;

import com.witframework.core.ServiceCallback;

public interface ISimpleHibernateDao<T> extends IBaseDao{

	/* (non-Javadoc)
	 * @see com.witframework.core.persistence.ISimpleHibernateDao#setEntityClass(java.lang.Class, boolean)
	 */
	public abstract void setEntityClass(Class clazz, boolean noMem);

	//protected abstract CommonHibernateDao getDao();

	//public abstract void delete(Object o) throws DataAccessException;

	public abstract void delete(Object o, ServiceCallback callback) throws DataAccessException;

	public abstract void deleteAll(Collection entities);

	public abstract void deleteAll(Collection entities, ServiceCallback callback);

	public abstract void deleteAll();

	public abstract void deleteAll(ServiceCallback callback);

	public abstract void deleteAllByIds(String... ids) throws DataAccessException;

	public abstract void deleteAllByIds(ServiceCallback callback, String... ids) throws DataAccessException;

	public abstract void deleteBy(String propertyName, Object value);

	public abstract void deleteBy(String propertyName, Object value, ServiceCallback callback);

	public abstract void deleteById(Serializable id) throws DataAccessException;

	public abstract void deleteById(Serializable id, ServiceCallback callback) throws DataAccessException;

	public abstract List findBy(Map filter);

	public abstract List findBy(Map filter, String orderBy, boolean isAsc);

	public abstract List findBy(String propertyName, Object value);

	public abstract Object findById(Serializable id) throws DataAccessException;

	public abstract Object findById(Serializable id, boolean lock) throws DataAccessException;

	public abstract List findByNamedQuery(String queryName) throws DataAccessException;

	public abstract List findByNamedQuery(String queryName, Object value) throws DataAccessException;

	public abstract List findByNamedQuery(String queryName, Object[] values) throws DataAccessException;

	public abstract List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value);

	public abstract List findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values) throws DataAccessException;

	public abstract List getAll() throws DataAccessException;

	public abstract int getAllSize() throws DataAccessException;

	public abstract Object getBy(String propertyName, Object value);

	public abstract Class getEntityClass();

	public abstract HibernateTemplate getHibernateTemplate();

	public abstract boolean isUnique(Object entity, String uniquePropertyNames);

	public abstract Object merge(Object o);

	public abstract List pagedQuery(Map filter, PageSortModel psm);

	public abstract List pagedQueryByNamedQuery(String queryName, PageSortModel psm) throws DataAccessException;

	public abstract List pagedQueryByNamedQuery(String queryName, Object value, PageSortModel psm) throws DataAccessException;

	public abstract List pagedQueryByNamedQuery(String queryName, Object[] values, PageSortModel psm) throws DataAccessException;

	public abstract List pagedQueryByNamedQueryAndNamedParam(String queryName, String paramName, Object value, PageSortModel psm);

	public abstract List pagedQueryByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values, PageSortModel psm);

	public abstract String save(Object entity, ServiceCallback callback) throws DataAccessException;

	public abstract String save(Object entity) throws DataAccessException;

	public abstract void saveAll(Collection entityCollection) throws DataAccessException;

	public abstract void saveAll(Collection entityCollection, ServiceCallback callback) throws DataAccessException;

	public abstract String saveOrUpdate(Object entity) throws DataAccessException;

	public abstract String saveOrUpdate(Object entity, ServiceCallback callback) throws DataAccessException;

	public abstract void saveOrUpdateAll(Collection entityCollection) throws DataAccessException;

	public abstract void saveOrUpdateAll(Collection entityCollection, ServiceCallback callback) throws DataAccessException;

	public abstract void update(Object entity) throws DataAccessException;

	public abstract void update(Object entity, ServiceCallback callback) throws DataAccessException;

}